#-*- coding:utf-8 -*-
'''
Created on 2013-5-30

@author: Administrator
'''
# abs(num)
#coerce(num1, num2)将两个数转化为同一个类型
#divmod(num1, num2)
#pow(num1,num2,mod=1)
#round(flt, ndig=0)
import math
from lib2to3.fixer_util import String
import string

print math.floor(( 1 / 2))

print 3 // 2

#为运算只适用整数
print ~2

s = 's'

print cmp(2, 2)
print str(0xff)
print int(4.25555)

print long(42)
print float(4)

print bool(-1)

print coerce(1, 134L)

print divmod(10, 3)
#四舍五入
print round(3.55)
print math.floor(3.4)
for eachNum in range(10):
    print round(math.pi, eachNum)
    
print s
#运用于整数的函数
print hex(255)
print oct(112)
print ord('a')
print chr(97)

#你不能混用十进制浮点数和普通的浮点数

from decimal import Decimal
dec = Decimal('1.1')
print dec + Decimal('2.1')
print 0.1

print string.ascii_letters
print string.ascii_lowercase
print string.ascii_uppercase